<template>
	<div>
		<div class="head">
			<a @click="$router.back(-1)" class="return"></a>
			{{$t("Lang.v1")}}
		</div>
		<div class="overlay">

			<van-radio-group v-model="radio">
			<van-cell-group>
				<van-cell title="简体中文" clickable @click="change('1')">
					<van-radio slot="right-icon" name="1" />
				</van-cell>
				<van-cell title="English" clickable @click="change('2')">
					<van-radio slot="right-icon" name="2" />
				</van-cell>
				<van-cell title="Tiếng việt" clickable @click="change('3')">
					<van-radio slot="right-icon" name="3" />
				</van-cell>
			</van-cell-group>
			</van-radio-group>

		</div>
		</div>
	</div>
</template>

<script>
export default {
    data(){
		return {
			radio: '1'
		}
	},
	mounted(){
		this.radio = localStorage.leng
	},
	methods:{
		change(i){
			localStorage.leng = i
			this.radio = localStorage.leng
			if(i == '1'){
				this.$i18n.locale='cn';
          this.axios.defaults.headers.common['Language'] = 'zh_CN';
			}else if(i == '2'){
				this.$i18n.locale='en';
          this.axios.defaults.headers.common['Language'] = 'en_US';
			}else if(i == '3'){
				this.$i18n.locale='vi';
          this.axios.defaults.headers.common['Language'] = 'vi_VN';
			}
		}
	}
}
</script>

<style lang="less" scoped>
/deep/.van-cell{
	color:#fff;
}
/deep/.van-cell--clickable:active{
	background:#2c3145;
}
/deep/[class*=van-hairline]::after{
	border:0;
}
</style>

